﻿package baidu.ui.containers
{
    import baidu.dv.core.*;
    import baidu.ui.core.*;
    import flash.display.*;

    public class ContainerBase extends BUI
    {
        protected var _children:Array;

        public function ContainerBase()
        {
            this._children = [];
            return;
        }// end function

        public function set children(param1:Array) : void
        {
            var _loc_2:* = undefined;
            this._children = param1;
            for each (_loc_2 in param1)
            {
                
                if (_loc_2 is DisplayObject)
                {
                    addChild(_loc_2);
                }
            }
            return;
        }// end function

        public function get children() : Array
        {
            return this._children;
        }// end function

        override protected function draw() : void
        {
            if (isInvalid(Invalidation.LAYOUT, Invalidation.STYLES, Invalidation.SIZE))
            {
                this.drawBorder();
            }
            super.draw();
            return;
        }// end function

        protected function drawBorder() : void
        {
            var _loc_1:* = getStyleValue("borderStyle");
            var _loc_2:* = getStyleValue("bottomBorderStyle");
            this.graphics.clear();
            if (_loc_2)
            {
                this.graphics.lineStyle(_loc_2.thickness, _loc_2.color, _loc_2.alpha);
                this.graphics.moveTo(0, height);
                this.graphics.lineTo(width, height);
            }
            return;
        }// end function

    }
}
